// promise改造后的pool数据库查询

const mysql = require('mysql')
const promisify = require('util').promisify


const pool = mysql.createPool({
    host: '127.0.0.1',
    user: 'root',
    password: '123456',
    database: 'big_event'
})

// 改造成 promise   要重新绑定到pool
const query = promisify(pool.query)

// 更新，换成同步的query
pool.query = query

module.exports = pool